//
//  QueryContainerMassLossDetailVC.m
//  CJRailTransport
//
//  Created by Hank on 2018/2/3.
//  Copyright © 2018年 amplity. All rights reserved.
//

#import "QueryContainerMassLossDetailVC.h"
#import "QueryContainerMassLossDetailCell.h"

@interface QueryContainerMassLossDetailVC ()
// 质损数据数组
@property (strong, nonatomic) NSMutableArray *massLossDataArray;

@end

@implementation QueryContainerMassLossDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 设置导航栏
    [self setNavC];
    // 设置界面属性
    [self setViewAttribute];
    // 注册Cell
    [self registerCells];
    // 测试数据
    [self testData];
}

#pragma mark - 导航栏
- (void)setNavC
{
    self.title = @"质损详细";
    // 设置导航栏颜色
    BasicNavigationController *nVC = (BasicNavigationController *)self.navigationController;
    nVC.themeColor = [UIColor whiteColor];
    nVC.tintColor = [UIColor darkGrayColor];
}

// 设置界面属性
- (void)setViewAttribute
{
    self.view.backgroundColor = [UIColor whiteColor];
}

// 注册Cell
- (void)registerCells
{
    UINib *nib = [UINib nibWithNibName:[QueryContainerMassLossDetailCell reuseIdentifier] bundle:nil];
    [_myTableView registerNib:nib forCellReuseIdentifier:[QueryContainerMassLossDetailCell reuseIdentifier]];
}

#pragma mark - initArray
// 初始化数组
- (NSMutableArray *)massLossDataArray
{
    if (!_massLossDataArray) {
        _massLossDataArray = [[NSMutableArray alloc]init];
    }
    return _massLossDataArray;
}

// 测试数据
- (void)testData
{
    NSArray *dataArray = @[@{@"维修":@"让湖路"},@{@"送修":@"满洲里"},@{@"滞留":@"满洲里"},@{@"报损":@"马拉"}];
    _massLossDataArray = [NSMutableArray arrayWithArray:dataArray];
}

#pragma mark - TableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _massLossDataArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    QueryContainerMassLossDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:[QueryContainerMassLossDetailCell reuseIdentifier] forIndexPath:indexPath];
    cell.indexPath = indexPath;
    [cell setData:_massLossDataArray];
    return cell;
}

#pragma mark - TableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
